package cn.yq.aio.base;

import android.app.Application;
import android.os.Handler;

import me.jessyan.autosize.AutoSizeConfig;
import me.jessyan.autosize.utils.AutoSizeUtils;

public class MyApp extends Application {

    public static MyApp instance;
    public Handler handler;

    @Override
    public void onCreate() {
        super.onCreate();
        instance = this;
        handler = new Handler(getMainLooper());
        AutoSizeConfig.getInstance().setBaseOnWidth(false).setDesignWidthInDp(360);
    }

    public static int dp2px(float dp) {
        return AutoSizeUtils.dp2px(instance, dp);
    }

    public static MyApp getInstance() {
        return instance;
    }

    public Handler getHandler() {
        return handler;
    }
}
